clear all

set more off

use "${datapath}/fascism_db.dta",clear

* standardize dependent and independent vars
foreach var of varlist fascist_violence-strike_agr_1920 lpop1911-volunteers1866_pop rain1918-rain_var {
egen z_`var'=std(`var')
}

* relabel them
run "labels.do"


local cntls_spec1 "z_lpop1911 z_lpop2 z_lpop3 z_lpop4 z_sh_pop_1911_be6 d_reg* province*"
local cntls_spec2 "`cntls_spec1' z_larea z_centre_alt z_max_alt"
local cntls_spec3 "`cntls_spec2' z_psu1913_vv"
local cntls_spec4 "`cntls_spec3' z_veterans74_95 z_veterans96_00 z_ard_vol_pop6m z_cruent_d z_army_suppliers_d"
local cntls_spec5 "`cntls_spec4' z_dlab z_shcrop z_landlord_ass"
local cntls_spec6 "`cntls_spec5' z_ind_workers z_ind_firms z_literacy z_elites z_bourgeoisie"


*TAB_1 FIRST STAGE
foreach i of numlist 1/6 {
qui reg z_psu1919_vv z_foots_pop6m `cntls_spec`i'', cl(circondario1921)
qui test z_foots_pop6m
outreg2 using "${outpath}/TAB_1.tex", dec(2) keep(z_foots_pop6m z_veterans74_95 z_veterans96_00 z_ard_vol_pop6m) addstat("Number of clusters", e(N_clust),"1st stage F-stat", r(F)) nocons label noaster append
}

*TAB_2
*PANEL A
foreach i of numlist 1/6 {
qui ivreg2 z_fascist_violence (z_psu1919_vv=z_foots_pop6m) `cntls_spec`i'', partial(d_reg* province*) cl(circondario1921)
outreg2 using "${outpath}/TAB_2A.tex", dec(2) keep(z_psu1919_vv) addstat("Number of clusters", e(N_clust)) nocons label noaster append
}
*PANEL B
foreach i of numlist 1/6 {
qui reg z_fascist_violence z_psu1919_vv `cntls_spec`i'', cl(circondario1921)
outreg2 using "${outpath}/TAB_2B.tex", dec(2) keep(z_psu1919_vv) addstat("Number of clusters", e(N_clust)) nocons label noaster append
}
*PANEL C
foreach i of numlist 1/6 {
qui ivreg2 z_fascist_branch (z_psu1919_vv=z_foots_pop6m) `cntls_spec`i'', partial(d_reg* province*) cl(circondario1921)
outreg2 using "${outpath}/TAB_2C.tex", dec(2) keep(z_psu1919_vv) addstat("Number of clusters", e(N_clust)) nocons label noaster append
}
*PANEL D
foreach i of numlist 1/6 {
qui reg z_fascist_branch z_psu1919_vv `cntls_spec`i'', cl(circondario1921)
outreg2 using "${outpath}/TAB_2D.tex", dec(2) keep(z_psu1919_vv) addstat("Number of clusters", e(N_clust)) nocons label noaster append
}

*TAB 2SLS MAIN2
*PANEL A
foreach i of numlist 1/6 {
qui ivreg2 z_fascist1921_vv (z_psu1919_vv=z_foots_pop6m) `cntls_spec`i'', partial(d_reg* province*) cl(circondario1921)
outreg2 using "${outpath}/TAB_3A.tex", dec(2) keep(z_psu1919_vv) addstat("Number of clusters", e(N_clust)) nocons label noaster append
}
*PANEL B
foreach i of numlist 1/6 {
qui reg z_fascist1921_vv z_psu1919_vv `cntls_spec`i'', cl(circondario1921)
outreg2 using "${outpath}/TAB_3B.tex", dec(2) keep(z_psu1919_vv) addstat("Number of clusters", e(N_clust)) nocons label noaster append
}
*PANEL C
foreach i of numlist 1/6 {
qui ivreg2 z_fascist1924_vv (z_psu1919_vv=z_foots_pop6m) `cntls_spec`i'', partial(d_reg* province*) cl(circondario1921)
outreg2 using "${outpath}/TAB_3C.tex", dec(2) keep(z_psu1919_vv) addstat("Number of clusters", e(N_clust)) nocons label noaster append
}
*PANEL D
foreach i of numlist 1/6 {
qui reg z_fascist1924_vv z_psu1919_vv `cntls_spec`i'', cl(circondario1921)
outreg2 using "${outpath}/TAB_3D.tex", dec(2) keep(z_psu1919_vv) addstat("Number of clusters", e(N_clust)) nocons label noaster append
}

*TAB4
*PANEL A
foreach i of numlist 1/6 {
qui ivreg2 z_psu1920d (z_psu1919_vv=z_foots_pop6m) `cntls_spec`i'', partial(d_reg* province*) cl(circondario1921)
outreg2 using "${outpath}/TAB_4A.tex", dec(2) keep(z_psu1919_vv) addstat("Number of clusters", e(N_clust)) nocons label noaster append
}
*panel B
foreach i of numlist 1/6 {
qui reg z_psu1920d z_psu1919_vv `cntls_spec`i'', cl(circondario1921)
outreg2 using "${outpath}/TAB_4B.tex", dec(2) keep(z_psu1919_vv) addstat("Number of clusters", e(N_clust)) nocons label noaster append
}
*PANEL C
foreach i of numlist 1/6 {
qui ivreg2 z_strike_agr_1920 (z_psu1919_vv=z_foots_pop6m) `cntls_spec`i'', partial(d_reg* province*) cl(circondario1921)
outreg2 using "${outpath}/TAB_4C.tex", dec(2) keep(z_psu1919_vv) addstat("Number of clusters", e(N_clust)) nocons label noaster append
}
*PANEL D
foreach i of numlist 1/6 {
qui reg z_strike_agr_1920 z_psu1919_vv `cntls_spec`i'', cl(circondario1921)
outreg2 using "${outpath}/TAB_4D.tex", dec(2) keep(z_psu1919_vv) addstat("Number of clusters", e(N_clust)) nocons label noaster append
}

*TAB5
***Panel A
foreach var in ppi traditional psu{
foreach i of numlist 1 4 6 {
qui ivreg2 z_`var'1921_vv (z_psu1919_vv=z_foots_pop6m) `cntls_spec`i'', partial(d_reg* province*) cl(circondario1921)
outreg2 using "${outpath}/TAB_5A.tex", dec(2) keep(z_psu1919_vv) addstat("Number of clusters", e(N_clust)) nocons label noaster append
}
}
***Panel B
foreach var in ppi traditional psu{
foreach i of numlist 1 4 6 {
qui reg z_`var'1921_vv z_foots_pop6m `cntls_spec`i'', cl(circondario1921)
outreg2 using "${outpath}/TAB_5B.tex", dec(2) keep(z_foots_pop6m) addstat("Number of clusters", e(N_clust)) nocons label noaster append
}
}
***Panel C
foreach var in ppi traditional psu{
foreach i of numlist 1 4 6 {
qui ivreg2 z_`var'1924_vv (z_psu1919_vv=z_foots_pop6m) `cntls_spec`i'', partial(d_reg* province*) cl(circondario1921)
outreg2 using "${outpath}/TAB_5C.tex", dec(2) keep(z_psu1919_vv) addstat("Number of clusters", e(N_clust)) nocons label noaster append
}
}
***Panel D
foreach var in ppi traditional psu{
foreach i of numlist 1 4 6 {
qui reg z_`var'1924_vv z_foots_pop6m `cntls_spec`i'', cl(circondario1921)
outreg2 using "${outpath}/TAB_5D.tex", dec(2) keep(z_foots_pop6m) addstat("Number of clusters", e(N_clust)) nocons label noaster append
}
}


*Table 6
*Panel A/B
g interaction=psu1919_vv*landlord_ass
egen z_interaction=std(interaction)
la var z_interaction	"Socialists x landowner association dummy"
g IV_interaction=foots_pop6m*landlord_ass
egen z_IV_interaction=std(IV_interaction)
la var z_IV_interaction	"Casualties x landowner association dummy"
foreach depvar in z_fascist_violence z_fascist_branch z_fascist1921_vv z_fascist1924_vv {
foreach i of numlist 1 4 6 {
qui ivreg2 `depvar' (z_psu1919_vv z_interaction =z_foots_pop6m z_IV_interaction) z_landlord_ass `cntls_spec`i'', partial(d_reg* province*) cl(circondario1921)
outreg2 using "${outpath}/TAB_6A.tex", dec(2) keep(z_psu1919_vv z_interaction) addstat("Number of clusters", e(N_clust), "Kleibergen-Paap F-stat", e(widstat)) nocons label noaster append
*
qui reg `depvar' z_foots_pop6m z_IV_interaction z_landlord_ass `cntls_spec`i'', cl(circondario1921)
outreg2 using "${outpath}/TAB_6B.tex", dec(2) keep(z_foots_pop6m z_IV_interaction) nocons label noaster append
}
}
drop interaction IV_interaction z_interaction z_IV_interaction
*Panel C/D
g interaction=psu1919_vv*z_elites
egen z_interaction=std(interaction)
la var z_interaction	"Socialists x elites"
g IV_interaction=foots_pop6m*z_elites
egen z_IV_interaction=std(IV_interaction)
la var z_IV_interaction	"Casualties x elites"
foreach depvar in z_fascist_violence z_fascist_branch z_fascist1921_vv z_fascist1924_vv {
foreach i of numlist 1 4 6 {
qui ivreg2 `depvar' (z_psu1919_vv z_interaction =z_foots_pop6m z_IV_interaction) z_elites `cntls_spec`i'', partial(d_reg* province*) cl(circondario1921)
outreg2 using "${outpath}/TAB_6C.tex", dec(2) keep(z_psu1919_vv z_interaction) addstat("Number of clusters", e(N_clust), "Kleibergen-Paap F-stat", e(widstat)) nocons label noaster append
*
qui reg `depvar' z_foots_pop6m z_IV_interaction z_elites `cntls_spec`i'', cl(circondario1921)
outreg2 using "${outpath}/TAB_6D.tex", dec(2) keep(z_foots_pop6m z_IV_interaction) nocons label noaster append
}
}
drop interaction IV_interaction z_interaction z_IV_interaction


*TAB7
***DUMMY
*PANEL A
foreach i of numlist 1/6 {
qui ivreg2 z_deportations_d (z_fascist1924_vv=z_foots_pop6m) z_jewish_pop1911 z_nazi_occ_duration `cntls_spec`i'', partial(d_reg* province*) cl(circondario1921)
outreg2 using "${outpath}/TAB_7A.tex", dec(2) keep(z_fascist1924_vv) addstat("Number of clusters", e(N_clust), "1st stage F-stat", e(widstat)) nocons label noaster append
}
***CAPPED AT 1
*PANEL B
foreach i of numlist 1/6 {
qui ivreg2 z_depo_pop_cap1 (z_fascist1924_vv=z_foots_pop6m) z_jewish_pop1911 z_nazi_occ_duration `cntls_spec`i'', partial(d_reg* province*) cl(circondario1921)
outreg2 using "${outpath}/TAB_7B.tex", dec(2) keep(z_fascist1924_vv) addstat("Number of clusters", e(N_clust), "1st stage F-stat", e(widstat)) nocons label noaster append
}
***CAPPED AT 1 NO CAMPS
*PANEL C
foreach i of numlist 1/6 {
qui ivreg2 z_depo_pop_cap1 (z_fascist1924_vv=z_foots_pop6m) z_jewish_pop1911 z_nazi_occ_duration `cntls_spec`i'' if KZ!=1, partial(d_reg* province*) cl(circondario1921)
outreg2 using "${outpath}/TAB_7C.tex", dec(2) keep(z_fascist1924_vv) addstat("Number of clusters", e(N_clust), "1st stage F-stat", e(widstat)) nocons label noaster append
}
